<?php
#####################################################
# RWCARDS - Joomla E-Cards Componment!
# Copyright (C) 2004/2005 by Ralf Weber
# Company    : Superwebba
# Homepage   : www.weberr.de
# Version    : 2.1.0
# Date       : 23/09/2005
# License    : Released under GPL
######################################################


defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

require_once( $mainframe->getPath( 'admin_html' ) );

// Pager
require_once($GLOBALS['mosConfig_live_site'] . '/components/com_rwcards/Pager/Pager.php');

class rwcards_config
{
function RWCardsConfig()
{
	global $database;
	include_once($GLOBALS['mosConfig_absolute_path'].'/administrator/components/com_rwcards/admin.rwcards.config.html.php');
	
	$database->setQuery("SELECT * FROM #__rwcardsconfig");
	$rows = $database->loadObjectList();
	
	rwcards_html::setRWCardsMainscreen();
	rwcards_config_html::setRWCardsConfig(_ADMIN_RWCARDS_MENU_TITLE . " " . _RWCARDS_VERSION, $rows[0]);
}

function RWCardsConfigSave()
{
	global $database;
	
	$database->setQuery("update #__rwcardsconfig set lifetime = '" .  $_REQUEST['rwcards_config_lifetime'] . "', maxadvanced  = '" .  $_REQUEST['rwcards_config_maxadvanced'] . "', cardsperpage  = '" .  $_REQUEST['rwcards_config_cardsperpage'] . "'");
	if (!$database->query())
	{
		echo "<script> alert('".$database->getErrorMsg()."'); </script>";
	}
	mosRedirect( "index2.php?option=com_rwcards" );
}

}//end class
?>